{#include file="top.php"#}
<div class="body">
    <div class="main">

        <div class="basic_info b_box">
            <div class="hd">
                <h2 class="hd_title">基本資料</h2>
            </div>
            <form id="form1" enctype="multipart/form-data" action="member.php?action=changePassword" method="POST">
                <div class="bd">
                    <div class="basic_info_box">
                        <p class="c_title">
                            更改密碼
                        </p>
                        <p class="name_p">
                            密碼
                        </p>
                        <input type="password" class="info_ipt_text" id="password" name="password" value=""/>
                        <p class="tip" style="display:none;"  id="password_tip">
                            <em class="hack"></em>
                            <a class="close" href="#"> <span></span> </a>
                            <span id="password_tip_text">{#$ERR_PWD#}</span>
                        </p>
                        <p class="name_p">
                            確認密碼
                        </p>
                        <input type="password" class="info_ipt_text" id="cpassword" name="cpassword"  value=""/>
                        <p class="tip" style="display:none;"  id="cpassword_tip">
                            <em class="hack"></em>
                            <a class="close" href="#"> <span></span> </a>
                            <span id="cpassword_tip_text">{#$ERR_CPWD#}</span>
                        </p>
                    </div>
                </div>
                <div class="other_login" style="top:50px">
                    <div class="lgbox">
                        <em class="hack"></em>
                        <a href="member.php?action=login_facebook&toURL={#$toURL#}" class="fbtn"><strong>以facebook登入</strong></a><p>以facebook登入</p>
                    </div>
                    <div>
                        <em class="hack"></em>
                        <a href="member.php?action=login_fnb&toURL={#$toURL#}" class="fabtn"><strong>以F&B登入 </strong></a><p>以F&B登入 </p>
                    </div>
                </div>
        </div>
        <input type="hidden" name="membercode" value="{#$membercode#}" />				
        <input type="hidden" name="mid" value="{#$mid#}" />								
        <input name="toURL" type="hidden" value="{#$toURL#}" />
        <p><a class="btn_s btn_s_next" style="cursor:pointer"  onclick="check_register();"><strong>下一步</strong></a>

            <a href="member.php?action=forgetPassword">忘記密碼</a>  
            <a href="member.php?action=reg&toURL=/">註冊</a> 
        </p>
        </form>	
    </div>
</div>	

<!-- main-->
<div class="sidebar">
    {#show_block('b2',1,'','sidebar_ad')#}
    {#show_block('b1',2,'','sidebar_function')#}
    {#show_block('b6',0,'','sidebar_facebook')#}
</div>
<!-- sidebar -->

</div><!--body-->		




<script>
    $(document).ready(function(){

        $('#password').focus();

        $('#password').blur(check_register_password);
        $('#password').keyup(check_register_password);		

        $('#cpassword').blur(check_register_cpassword);
        $('#cpassword').keyup(check_register_cpassword);	
		
    }); 
    function check_cssby(tipmainname){

        var obj =$("#"+tipmainname+"_tip");
        if(obj.attr('class')!='tip'){
            return 1;
        }else{
            return 0;
        }
    }
    function check_register_password(){
        var rt = 0;
        var password = $('#password').val();
        if(password.match(/^.{6,20}$/i) == null){
            $("#password_tip").addClass("tip").show();
            $("#password_tip_text").html('{#$ERR_PWD#}')
        }else{
            $("#password_tip").removeClass("tip").hide();
            rt =  1;
        }
        return rt;
    }
	
    function check_register_cpassword(){
        var rt = 0;
        var password = $('#password').val();
        var cpassword = $('#cpassword').val();
        if(cpassword != '' && password != cpassword){
            $("#cpassword_tip").addClass("tip").show();
            $("#cpassword_tip_text").html('{#$ERR_CPWD#}')
        }else if(cpassword != '' && password == cpassword){
            $("#cpassword_tip").removeClass("tip").hide();
            rt =  1;
        }
        return rt;
    }
    function check_register(){
        if($('#password').val().length==0){
            $('#password').focus();
            //alert("{#$ERR_PWD#}");
            return false;
        }else if($('#cpassword').val().length==0){
            $('#cpassword').focus();
            //alert("{#$ERR_CPWD#}");
            return false;
        }else if(check_cssby('cpassword') != 1){
            $('#cpassword').focus();
            //alert("{#$ERR_CPWD#}");
            return false;
        }else{
            /*
                        var captcha=$('#captcha').val();
                        $.get("{#$selfurl#}?action=ajax_checkCaptcha",{captcha:captcha},function(data){
                                if(data=='false'){
                                        alert("{#$ERR_CAPTCHA#}");
                                        $('#captcha').focus();
                                        $('#captcha_img').attr("src","captcha.php?t="+Math.random());
                                        return false;
                                }else{
                                        $("#form1").submit();
                                }
                        });
             */
            $("#form1").submit();
        }
    }
	
</script>
{#include file="footer.php"#}